// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate iam_v1;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Request message for BeyondCorp.ListAppConnections.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppConnectionsRequest {
    /// Required. The resource name of the AppConnection location using the form:
    /// `projects/{project_id}/locations/{location_id}`
    pub parent: std::string::String,

    /// Optional. The maximum number of items to return.
    /// If not specified, a default value of 50 will be used by the service.
    /// Regardless of the page_size value, the response may include a partial list
    /// and a caller should only rely on response's
    /// [next_page_token][BeyondCorp.ListAppConnectionsResponse.next_page_token] to
    /// determine if there are more instances left to be queried.
    pub page_size: i32,

    /// Optional. The next_page_token value returned from a previous
    /// ListAppConnectionsRequest, if any.
    pub page_token: std::string::String,

    /// Optional. A filter specifying constraints of a list operation.
    pub filter: std::string::String,

    /// Optional. Specifies the ordering of results. See
    /// [Sorting
    /// order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
    /// for more information.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAppConnectionsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListAppConnectionsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListAppConnectionsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListAppConnectionsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListAppConnectionsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListAppConnectionsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListAppConnectionsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsRequest"
    }
}

/// Response message for BeyondCorp.ListAppConnections.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppConnectionsResponse {
    /// A list of BeyondCorp AppConnections in the project.
    pub app_connections: std::vec::Vec<crate::model::AppConnection>,

    /// A token to retrieve the next page of results, or empty if there are no more
    /// results in the list.
    pub next_page_token: std::string::String,

    /// A list of locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAppConnectionsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [app_connections][crate::model::ListAppConnectionsResponse::app_connections].
    pub fn set_app_connections<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::AppConnection>,
    {
        use std::iter::Iterator;
        self.app_connections = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListAppConnectionsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListAppConnectionsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListAppConnectionsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.ListAppConnectionsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListAppConnectionsResponse {
    type PageItem = crate::model::AppConnection;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.app_connections
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for BeyondCorp.GetAppConnection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAppConnectionRequest {
    /// Required. BeyondCorp AppConnection name using the form:
    /// `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetAppConnectionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetAppConnectionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetAppConnectionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.GetAppConnectionRequest"
    }
}

/// Request message for BeyondCorp.CreateAppConnection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAppConnectionRequest {
    /// Required. The resource project name of the AppConnection location using the
    /// form: `projects/{project_id}/locations/{location_id}`
    pub parent: std::string::String,

    /// Optional. User-settable AppConnection resource ID.
    ///
    /// * Must start with a letter.
    /// * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
    /// * Must end with a number or a letter.
    pub app_connection_id: std::string::String,

    /// Required. A BeyondCorp AppConnection resource.
    pub app_connection: std::option::Option<crate::model::AppConnection>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and t
    /// he request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. If set, validates request by executing a dry-run which would not
    /// alter the resource in any way.
    pub validate_only: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateAppConnectionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateAppConnectionRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [app_connection_id][crate::model::CreateAppConnectionRequest::app_connection_id].
    pub fn set_app_connection_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.app_connection_id = v.into();
        self
    }

    /// Sets the value of [app_connection][crate::model::CreateAppConnectionRequest::app_connection].
    pub fn set_app_connection<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AppConnection>,
    {
        self.app_connection = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [app_connection][crate::model::CreateAppConnectionRequest::app_connection].
    pub fn set_or_clear_app_connection<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AppConnection>,
    {
        self.app_connection = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateAppConnectionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [validate_only][crate::model::CreateAppConnectionRequest::validate_only].
    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.validate_only = v.into();
        self
    }
}

impl wkt::message::Message for CreateAppConnectionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.CreateAppConnectionRequest"
    }
}

/// Request message for BeyondCorp.UpdateAppConnection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAppConnectionRequest {
    /// Required. Mask of fields to update. At least one path must be supplied in
    /// this field. The elements of the repeated paths field may only include these
    /// fields from [BeyondCorp.AppConnection]:
    ///
    /// * `labels`
    /// * `display_name`
    /// * `application_endpoint`
    /// * `connectors`
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. AppConnection message with updated fields. Only supported fields
    /// specified in update_mask are updated.
    pub app_connection: std::option::Option<crate::model::AppConnection>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and t
    /// he request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. If set, validates request by executing a dry-run which would not
    /// alter the resource in any way.
    pub validate_only: bool,

    /// Optional. If set as true, will create the resource if it is not found.
    pub allow_missing: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateAppConnectionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateAppConnectionRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateAppConnectionRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [app_connection][crate::model::UpdateAppConnectionRequest::app_connection].
    pub fn set_app_connection<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AppConnection>,
    {
        self.app_connection = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [app_connection][crate::model::UpdateAppConnectionRequest::app_connection].
    pub fn set_or_clear_app_connection<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AppConnection>,
    {
        self.app_connection = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateAppConnectionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [validate_only][crate::model::UpdateAppConnectionRequest::validate_only].
    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.validate_only = v.into();
        self
    }

    /// Sets the value of [allow_missing][crate::model::UpdateAppConnectionRequest::allow_missing].
    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.allow_missing = v.into();
        self
    }
}

impl wkt::message::Message for UpdateAppConnectionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.UpdateAppConnectionRequest"
    }
}

/// Request message for BeyondCorp.DeleteAppConnection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAppConnectionRequest {
    /// Required. BeyondCorp Connector name using the form:
    /// `projects/{project_id}/locations/{location_id}/appConnections/{app_connection_id}`
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and t
    /// he request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. If set, validates request by executing a dry-run which would not
    /// alter the resource in any way.
    pub validate_only: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteAppConnectionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteAppConnectionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteAppConnectionRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [validate_only][crate::model::DeleteAppConnectionRequest::validate_only].
    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.validate_only = v.into();
        self
    }
}

impl wkt::message::Message for DeleteAppConnectionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.DeleteAppConnectionRequest"
    }
}

/// Request message for BeyondCorp.ResolveAppConnections.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResolveAppConnectionsRequest {
    /// Required. The resource name of the AppConnection location using the form:
    /// `projects/{project_id}/locations/{location_id}`
    pub parent: std::string::String,

    /// Required. BeyondCorp Connector name of the connector associated with those
    /// AppConnections using the form:
    /// `projects/{project_id}/locations/{location_id}/appConnectors/{app_connector_id}`
    pub app_connector_id: std::string::String,

    /// Optional. The maximum number of items to return.
    /// If not specified, a default value of 50 will be used by the service.
    /// Regardless of the page_size value, the response may include a partial list
    /// and a caller should only rely on response's
    /// [next_page_token][BeyondCorp.ResolveAppConnectionsResponse.next_page_token]
    /// to determine if there are more instances left to be queried.
    pub page_size: i32,

    /// Optional. The next_page_token value returned from a previous
    /// ResolveAppConnectionsResponse, if any.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResolveAppConnectionsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ResolveAppConnectionsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [app_connector_id][crate::model::ResolveAppConnectionsRequest::app_connector_id].
    pub fn set_app_connector_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.app_connector_id = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ResolveAppConnectionsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ResolveAppConnectionsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ResolveAppConnectionsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsRequest"
    }
}

/// Response message for BeyondCorp.ResolveAppConnections.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResolveAppConnectionsResponse {
    /// A list of BeyondCorp AppConnections with details in the project.
    pub app_connection_details:
        std::vec::Vec<crate::model::resolve_app_connections_response::AppConnectionDetails>,

    /// A token to retrieve the next page of results, or empty if there are no more
    /// results in the list.
    pub next_page_token: std::string::String,

    /// A list of locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResolveAppConnectionsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [app_connection_details][crate::model::ResolveAppConnectionsResponse::app_connection_details].
    pub fn set_app_connection_details<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::resolve_app_connections_response::AppConnectionDetails>,
    {
        use std::iter::Iterator;
        self.app_connection_details = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ResolveAppConnectionsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ResolveAppConnectionsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ResolveAppConnectionsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ResolveAppConnectionsResponse {
    type PageItem = crate::model::resolve_app_connections_response::AppConnectionDetails;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.app_connection_details
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Defines additional types related to [ResolveAppConnectionsResponse].
pub mod resolve_app_connections_response {
    #[allow(unused_imports)]
    use super::*;

    /// Details of the AppConnection.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AppConnectionDetails {
        /// A BeyondCorp AppConnection in the project.
        pub app_connection: std::option::Option<crate::model::AppConnection>,

        /// If type=GCP_REGIONAL_MIG, contains most recent VM instances, like
        /// `<https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}>`.
        pub recent_mig_vms: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AppConnectionDetails {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [app_connection][crate::model::resolve_app_connections_response::AppConnectionDetails::app_connection].
        pub fn set_app_connection<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::AppConnection>,
        {
            self.app_connection = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [app_connection][crate::model::resolve_app_connections_response::AppConnectionDetails::app_connection].
        pub fn set_or_clear_app_connection<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::AppConnection>,
        {
            self.app_connection = v.map(|x| x.into());
            self
        }

        /// Sets the value of [recent_mig_vms][crate::model::resolve_app_connections_response::AppConnectionDetails::recent_mig_vms].
        pub fn set_recent_mig_vms<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.recent_mig_vms = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for AppConnectionDetails {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails"
        }
    }
}

/// A BeyondCorp AppConnection resource represents a BeyondCorp protected
/// AppConnection to a remote application. It creates all the necessary GCP
/// components needed for creating a BeyondCorp protected AppConnection. Multiple
/// connectors can be authorised for a single AppConnection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AppConnection {
    /// Required. Unique resource name of the AppConnection.
    /// The name is ignored when creating a AppConnection.
    pub name: std::string::String,

    /// Output only. Timestamp when the resource was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Timestamp when the resource was last modified.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Resource labels to represent user provided metadata.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. An arbitrary user-provided name for the AppConnection. Cannot
    /// exceed 64 characters.
    pub display_name: std::string::String,

    /// Output only. A unique identifier for the instance generated by the
    /// system.
    pub uid: std::string::String,

    /// Required. The type of network connectivity used by the AppConnection.
    pub r#type: crate::model::app_connection::Type,

    /// Required. Address of the remote application endpoint for the BeyondCorp
    /// AppConnection.
    pub application_endpoint:
        std::option::Option<crate::model::app_connection::ApplicationEndpoint>,

    /// Optional. List of [google.cloud.beyondcorp.v1main.Connector.name] that are
    /// authorised to be associated with this AppConnection.
    pub connectors: std::vec::Vec<std::string::String>,

    /// Output only. The current state of the AppConnection.
    pub state: crate::model::app_connection::State,

    /// Optional. Gateway used by the AppConnection.
    pub gateway: std::option::Option<crate::model::app_connection::Gateway>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AppConnection {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::AppConnection::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::AppConnection::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::AppConnection::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::AppConnection::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::AppConnection::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::AppConnection::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [display_name][crate::model::AppConnection::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [uid][crate::model::AppConnection::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [r#type][crate::model::AppConnection::type].
    pub fn set_type<T: std::convert::Into<crate::model::app_connection::Type>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [application_endpoint][crate::model::AppConnection::application_endpoint].
    pub fn set_application_endpoint<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::app_connection::ApplicationEndpoint>,
    {
        self.application_endpoint = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [application_endpoint][crate::model::AppConnection::application_endpoint].
    pub fn set_or_clear_application_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::app_connection::ApplicationEndpoint>,
    {
        self.application_endpoint = v.map(|x| x.into());
        self
    }

    /// Sets the value of [connectors][crate::model::AppConnection::connectors].
    pub fn set_connectors<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.connectors = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [state][crate::model::AppConnection::state].
    pub fn set_state<T: std::convert::Into<crate::model::app_connection::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [gateway][crate::model::AppConnection::gateway].
    pub fn set_gateway<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::app_connection::Gateway>,
    {
        self.gateway = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [gateway][crate::model::AppConnection::gateway].
    pub fn set_or_clear_gateway<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::app_connection::Gateway>,
    {
        self.gateway = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for AppConnection {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.AppConnection"
    }
}

/// Defines additional types related to [AppConnection].
pub mod app_connection {
    #[allow(unused_imports)]
    use super::*;

    /// ApplicationEndpoint represents a remote application endpoint.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ApplicationEndpoint {
        /// Required. Hostname or IP address of the remote application endpoint.
        pub host: std::string::String,

        /// Required. Port of the remote application endpoint.
        pub port: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ApplicationEndpoint {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [host][crate::model::app_connection::ApplicationEndpoint::host].
        pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.host = v.into();
            self
        }

        /// Sets the value of [port][crate::model::app_connection::ApplicationEndpoint::port].
        pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.port = v.into();
            self
        }
    }

    impl wkt::message::Message for ApplicationEndpoint {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.AppConnection.ApplicationEndpoint"
        }
    }

    /// Gateway represents a user facing component that serves as an entrance to
    /// enable connectivity.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Gateway {
        /// Required. The type of hosting used by the gateway.
        pub r#type: crate::model::app_connection::gateway::Type,

        /// Output only. Server-defined URI for this resource.
        pub uri: std::string::String,

        /// Output only. Ingress port reserved on the gateways for this
        /// AppConnection, if not specified or zero, the default port is 19443.
        pub ingress_port: i32,

        /// Required. AppGateway name in following format:
        /// `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`
        pub app_gateway: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Gateway {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [r#type][crate::model::app_connection::Gateway::type].
        pub fn set_type<T: std::convert::Into<crate::model::app_connection::gateway::Type>>(
            mut self,
            v: T,
        ) -> Self {
            self.r#type = v.into();
            self
        }

        /// Sets the value of [uri][crate::model::app_connection::Gateway::uri].
        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.uri = v.into();
            self
        }

        /// Sets the value of [ingress_port][crate::model::app_connection::Gateway::ingress_port].
        pub fn set_ingress_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.ingress_port = v.into();
            self
        }

        /// Sets the value of [app_gateway][crate::model::app_connection::Gateway::app_gateway].
        pub fn set_app_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.app_gateway = v.into();
            self
        }
    }

    impl wkt::message::Message for Gateway {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway"
        }
    }

    /// Defines additional types related to [Gateway].
    pub mod gateway {
        #[allow(unused_imports)]
        use super::*;

        /// Enum listing possible gateway hosting options.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Type {
            /// Default value. This value is unused.
            Unspecified,
            /// Gateway hosted in a GCP regional managed instance group.
            GcpRegionalMig,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [Type::value] or
            /// [Type::name].
            UnknownValue(r#type::UnknownValue),
        }

        #[doc(hidden)]
        pub mod r#type {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl Type {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::GcpRegionalMig => std::option::Option::Some(1),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                    Self::GcpRegionalMig => std::option::Option::Some("GCP_REGIONAL_MIG"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for Type {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for Type {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for Type {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::GcpRegionalMig,
                    _ => Self::UnknownValue(r#type::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for Type {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "TYPE_UNSPECIFIED" => Self::Unspecified,
                    "GCP_REGIONAL_MIG" => Self::GcpRegionalMig,
                    _ => Self::UnknownValue(r#type::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for Type {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::GcpRegionalMig => serializer.serialize_i32(1),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for Type {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                    ".google.cloud.beyondcorp.appconnections.v1.AppConnection.Gateway.Type",
                ))
            }
        }
    }

    /// Enum containing list of all possible network connectivity options
    /// supported by BeyondCorp AppConnection.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Default value. This value is unused.
        Unspecified,
        /// TCP Proxy based BeyondCorp AppConnection. API will default to this if
        /// unset.
        TcpProxy,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::TcpProxy => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::TcpProxy,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "TCP_PROXY" => Self::TcpProxy,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::TcpProxy => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.beyondcorp.appconnections.v1.AppConnection.Type",
            ))
        }
    }

    /// Represents the different states of a AppConnection.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Default value. This value is unused.
        Unspecified,
        /// AppConnection is being created.
        Creating,
        /// AppConnection has been created.
        Created,
        /// AppConnection's configuration is being updated.
        Updating,
        /// AppConnection is being deleted.
        Deleting,
        /// AppConnection is down and may be restored in the future.
        /// This happens when CCFE sends ProjectState = OFF.
        Down,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Created => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::Down => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Created => std::option::Option::Some("CREATED"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Down => std::option::Option::Some("DOWN"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Created,
                3 => Self::Updating,
                4 => Self::Deleting,
                5 => Self::Down,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "CREATED" => Self::Created,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                "DOWN" => Self::Down,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Created => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::Down => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.beyondcorp.appconnections.v1.AppConnection.State",
            ))
        }
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AppConnectionOperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have [Operation.error][] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    ///
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AppConnectionOperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::AppConnectionOperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::AppConnectionOperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::AppConnectionOperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::AppConnectionOperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::AppConnectionOperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::AppConnectionOperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::AppConnectionOperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::AppConnectionOperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::AppConnectionOperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for AppConnectionOperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata"
    }
}
